<script setup>
import Header from "@/components/base/Header";
import {useRouter} from "vue-router";

const router = useRouter();
const clickLeft = () => {
  router.go(-1)
}
</script>

<div class="home flex_col">
<Header title="人员信息" :left="true" @clickLeft="clickLeft"
        right="text">
  <template v-slot:select>
    <span></span>
  </template>
</Header>
<div class="contents">
  <!-- 照片区域 -->
  <div class="photos-section">
    <!-- 安全帽照片 -->
    <div class="photo-item">
      <img src="/marker.png" alt="安全帽照片" class="worker-photo">
    </div>
    <!-- 证件照片 -->
    <div class="id-photos">
      <div class="photo-item">
        <img src="/marker.png" alt="证件照" class="id-photo">
      </div>
      <div class="photo-item">
        <img src="/marker.png" alt="身份证照" class="id-photo">
      </div>
    </div>
  </div>
  
  <!-- 个人信息区域 -->
  <div class="info-section">
    <div class="info-item">
      <span class="info-label">姓名</span>
      <span class="info-value">张三</span>
    </div>
    <div class="info-item">
      <span class="info-label">身份证号</span>
      <span class="info-value">522525000000000000</span>
    </div>
    <div class="info-item">
      <span class="info-label">出生日期</span>
      <span class="info-value">0000-00-00</span>
    </div>
    <div class="info-item">
      <span class="info-label">性别</span>
      <span class="info-value">男</span>
    </div>
    <div class="info-item">
      <span class="info-label">工种</span>
      <span class="info-value">安全员</span>
    </div>
    <div class="info-item">
      <span class="info-label">联系电话</span>
      <span class="info-value">18100000000</span>
    </div>
    <div class="info-item">
      <span class="info-label">籍贯</span>
      <span class="info-value">贵州省贵阳市</span>
    </div>
    <div class="info-item">
      <span class="info-label">住址</span>
      <span class="info-value">xxxxxxxxxxxxxxxxxxxxxxx</span>
    </div>
    <div class="info-item">
      <span class="info-label">劳务单位</span>
      <span class="info-value">xxxxxxxxxxxxxxx公司</span>
    </div>
    <div class="info-item">
      <span class="info-label">班组名称</span>
      <span class="info-value">xxxxxxxxxx班组</span>
    </div>
    <div class="info-item">
      <span class="info-label">登记时间</span>
      <span class="info-value">0000-00-00</span>
    </div>
    <div class="info-item">
      <span class="info-label">进场时间</span>
      <span class="info-value">0000-00-00</span>
    </div>
  </div>
</div>
</div>

<style scoped>
.flex_col {
  height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
}

.contents {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f5f5f5;
}

/* 照片区域样式 */
.photos-section {
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.photo-item {
  margin-right: 16px;
}

.worker-photo {
  width: 140px;
  height: 160px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  object-fit: cover;
}

.id-photos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.id-photo {
  width: 180px;
  height: 100px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  object-fit: cover;
}

/* 个人信息区域样式 */
.info-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.info-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  width: 100px;
  font-weight: 500;
  color: #606266;
  flex-shrink: 0;
}

.info-value {
  flex: 1;
  color: #303133;
  word-break: break-all;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .photos-section {
    flex-direction: column;
    align-items: center;
  }
  
  .worker-photo {
    width: 120px;
    height: 140px;
    margin-bottom: 16px;
  }
  
  .id-photos {
    flex-direction: row;
    justify-content: center;
  }
  
  .id-photo {
    width: 160px;
    height: 90px;
  }
  
  .info-label {
    width: 80px;
    font-size: 14px;
  }
  
  .info-value {
    font-size: 14px;
  }
}
</style>